﻿/**
*    Copyright (C) 2008  Chase Kernan 
*    chase.kernan@gmail.com
*
*    This program is free software: you can redistribute it and/or modify
*    it under the terms of the GNU General Public License as published by
*    the Free Software Foundation, either version 3 of the License, or
*    (at your option) any later version.
*
*    This program is distributed in the hope that it will be useful,
*    but WITHOUT ANY WARRANTY; without even the implied warranty of
*    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
*    GNU General Public License for more details.
*
*    You should have received a copy of the GNU General Public License
*    along with this program.  If not, see <http://www.gnu.org/licenses/>.
* 
**/

package com.chasekernan.hxnova.raceeditor;

import org.aswing.geom.IntDimension;
import org.aswing.JFrame;
import org.aswing.JLabel;
import org.aswing.JPanel;
import org.aswing.JTabbedPane;
import org.aswing.JTextArea;
import org.aswing.geom.IntPoint;

class RaceEditorUI extends JFrame {
    
    private var tabbedBase : JTabbedPane;
    private var basicsPanel : JPanel;
	private var raceNameLabel : JLabel;
	private var raceName : JTextArea;
	private var racePluralNameLabel : JLabel;
	private var racePluralName : JTextArea;
	private var prtPanel : JPanel;
	private var lrtPanel : JPanel;
	private var habPanel : JPanel;
	private var facMinePanel : JPanel;
	private var researchPanel : JPanel;
    
    public function new(?parent : Dynamic) {
        super(parent, "Race Editor");
        setContentPane(setupContent());
        setSize(new IntDimension(500, 450));
        pack();
    }
    
    private function setupContent() : JTabbedPane {
        tabbedBase = new JTabbedPane();
        tabbedBase.setSize(new IntDimension(500, 450));
        
        basicsPanel = new JPanel();
		basicsPanel.setName("Basics");
		basicsPanel.setLocation(new IntPoint(4, 28));
		basicsPanel.setSize(new IntDimension(492, 418));
		
		raceNameLabel = new JLabel();
		raceNameLabel.setLocation(new IntPoint(5, 5));
		raceNameLabel.setSize(new IntDimension(58, 17));
		raceNameLabel.setText("Race Name");
		
		raceName = new JTextArea();
		raceName.setLocation(new IntPoint(68, 5));
		raceName.setSize(new IntDimension(100, 21));
		raceName.setPreferredSize(new IntDimension(100, 21));
		raceName.setHtmlText("Name");
		raceName.setEditable(true);
		raceName.setWordWrap(false);
		
		racePluralNameLabel = new JLabel();
		racePluralNameLabel.setLocation(new IntPoint(173, 7));
		racePluralNameLabel.setSize(new IntDimension(87, 17));
		racePluralNameLabel.setText("Race Plural Name");
		
		racePluralName = new JTextArea();
		racePluralName.setLocation(new IntPoint(265, 5));
		racePluralName.setSize(new IntDimension(100, 21));
		racePluralName.setPreferredSize(new IntDimension(100, 21));
		racePluralName.setHtmlText("Plural Name");
		racePluralName.setWordWrap(false);
		
		prtPanel = new JPanel();
		prtPanel.setName("PRTs");
		prtPanel.setLocation(new IntPoint(4, 28));
		prtPanel.setSize(new IntDimension(492, 418));
		
		lrtPanel = new JPanel();
		lrtPanel.setName("LRTs");
		lrtPanel.setLocation(new IntPoint(4, 28));
		lrtPanel.setSize(new IntDimension(492, 418));
		
		habPanel = new JPanel();
		habPanel.setName("Habitat");
		habPanel.setLocation(new IntPoint(4, 28));
		habPanel.setSize(new IntDimension(492, 418));
		
		facMinePanel = new JPanel();
		facMinePanel.setName("Factories and Mines");
		facMinePanel.setLocation(new IntPoint(4, 28));
		facMinePanel.setSize(new IntDimension(492, 418));
		
		researchPanel = new JPanel();
		researchPanel.setName("Research");
		researchPanel.setLocation(new IntPoint(2, 32));
		researchPanel.setSize(new IntDimension(496, 416));
		
		//component layoution
		append(basicsPanel);
		append(prtPanel);
		append(lrtPanel);
		append(habPanel);
		append(facMinePanel);
		append(researchPanel);
		
		basicsPanel.append(raceNameLabel);
		basicsPanel.append(raceName);
		basicsPanel.append(racePluralNameLabel);
		basicsPanel.append(racePluralName);
        
        
        return tabbedBase;
    }
    
}